i find myself using the hide/restore window function outlined here often enough that it merited updating the Conky desktop in some fashion to reflect the presence of hidden windows associated with the desktop in focus. It didn’t take long to decide on simply highlighting the desktop (tag) number!
Note: the desktop (tag) numbers in the top right corner of a normal (no windows hidden) view.
has been augmented to restore the last or all hidden (moved) windows stored in (tick) ‘tag used to store windows temporarily from tag..
#!/bin/sh
function tag() {
herbstclient list_monitors | grep ‘[FOCUS]’ | cut -d’”’ -f2
}
tag=$(tag)
case "$@" in
+1) herbstclient dump “‘$tag” || herbstclient add “‘$tag”
herbstclient move “‘$tag”
;;
-1) if herbstclient dump “‘$tag”; then
herbstclient chain . lock . use “‘$tag”
winid=$(herbstclient attr clients.focus.winid)
herbstclient chain . use $tag . bring $winid . unlock
fi
;;
0|*) herbstclient dump “‘$tag” && herbstclient merge_tag “‘$tag” ;;
esac
The herbstluftwm autostart keybinds to hide and restore windows..
hc keybind $Mod-m spawn hide_window +1
hc keybind $Mod-Control-m spawn hide_window -1
hc keybind $Mod-Shift-m spawn hide_window 0
The following Conky scripts complete the hidden window notification..
returns the desktop tag of the monitor desktop in focus (or not), of the multihead setup..
#!/bin/sh
[[ $@ = focus ]] || focus=-v
herbstclient list_monitors | grep $focus '\[FOCUS\]' | cut -d'"' -f2
returns the “hidden” state of the monitor desktop in focus (or not), of the multihead setup..
#!/bin/sh
herbstclient dump "'$(query_desktop $@)" >/dev/null 2>&1 && echo 'hidden'
using the query_hidden script above, highlights the monitor desktop tag, if windows for that tag have been hidden (moved to) in (tick) ‘tag..
${if_match "${exec herbstclient list_monitors | grep '\[FOCUS\]' | cut -d: -f1}" == "1"}
${voffset -211}${font Ubuntu:size=48,weight:normal}${if_match "${exec query_hidden focus}" == "hidden"}${color}${else}${color3}${endif}${offset 136}${exec query_desktop focus}${font Ubuntu:size=16,weight:normal}${if_match "${exec query_hidden}" == "hidden"}${color}${else}${color4}${endif}${exec query_desktop}
${voffset -72}
${else}
${voffset -211}${font Ubuntu:size=48,weight:normal}${if_match "${exec query_hidden}" == "hidden"}${color}${else}${color4}${endif}${offset 136}${font Ubuntu:size=16,weight:normal}${exec query_desktop}${voffset -46}${font Ubuntu:size=48,weight:normal}${if_match "${exec query_hidden focus}" == "hidden"}${color}${else}${color3}${endif}${exec query_desktop focus}
${voffset -249}
${endif}
${font Ubuntu:size=7,weight:normal}${color3}${alignr}${exec herbstclient substitute CLASS clients.focus.class echo CLASS}
${voffset 106}
The offsets are specific to the Conky layout, in this case, the top right corner of the multihead setup.
Note: the highlighted desktop (tag) number in the top right corner indicating hidden windows associated with that tag.
Sometimes it is quicker to hide a window or two temporarily, to free up desktop real estate for working with side by side windows. Other times it is more expedient to manage frames with max view. herbstluftwm doesn’t place any restrictions on your desktop workflow and this hide/restore facility easily bests minimize/show with a mouse (if you are a keyboard junkie)..